  <!--
  
   DiplomacyScreen.xaml
  
   Copyright (c) 2007 Mike Strobel
  
   This source code is subject to the terms of the Microsoft Reciprocal License (Ms-RL).
   For details, see <http://www.opensource.org/licenses/ms-rl.html>.
  
   All other rights reserved.
  
  -->
<ResourceDictionary xmlns="http://schemas.microsoft.com/netfx/2007/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:sys="clr-namespace:System;assembly=mscorlib"
                    xmlns:local="clr-namespace:Supremacy.Client"
                    xmlns:ui="clr-namespace:Supremacy.UI;assembly=SupremacyUI"
                    xmlns:s="http://schemas.startreksupremacy.com/xaml/core"
                    xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid">

  <local:AgreementStipulationDescriptionConverter x:Key="AgreementStipulationDescriptionConverter" />

  <DataTemplate x:Key="AgreementStipulationItemTemplate">
    <TextBlock Margin="0,8,0,0"
               Text="{Binding Converter={StaticResource AgreementStipulationDescriptionConverter}}" />
  </DataTemplate>

  <DataTemplate x:Key="AgreementItemTemplate">
    <StackPanel Orientation="Vertical"
                TextBlock.Foreground="{StaticResource HeaderTextBrush}"
                TextBlock.TextAlignment="Left"
                Margin="0,8,0,8">
      <WrapPanel Orientation="Horizontal">
        <TextBlock Text="Agreement proposed to the " />
        <TextBlock Text="{Binding Path=Proposal.Recipient}"
                   TextBlock.Foreground="{StaticResource DefaultTextBrush}" />
        <TextBlock Text=" by the " />
        <TextBlock Text="{Binding Path=Proposal.Sender}"
                   TextBlock.Foreground="{StaticResource DefaultTextBrush}" />
      </WrapPanel>
      <TextBlock HorizontalAlignment="Left"
                 TextAlignment="Left">
        <TextBlock Text="Accepted on Turn" />
        <TextBlock Text="{Binding Path=TurnAccepted}" />
      </TextBlock>
      <ItemsControl ItemsSource="{Binding Path=Proposal.AllStipulations}"
                    Margin="28,0,0,0"
                    ItemTemplate="{StaticResource AgreementStipulationItemTemplate}"
                    TextBlock.Foreground="{StaticResource DefaultTextBrush}" />
    </StackPanel>
  </DataTemplate>

  <SolidColorBrush x:Key="CommBorderBrush"
                   Color="#FF848484" />
  <LinearGradientBrush x:Key="CommBackgroundBrush"
                       EndPoint="1,0.5"
                       StartPoint="0,0.5"
                       MappingMode="RelativeToBoundingBox"
                       Opacity="0.5">
    <LinearGradientBrush.RelativeTransform>
      <RotateTransform Angle="90" />
    </LinearGradientBrush.RelativeTransform>
    <GradientStop Color="#FF818181"
                  Offset="0" />
    <GradientStop Color="#FF323232"
                  Offset="1" />
  </LinearGradientBrush>

  <Style TargetType="{x:Type local:DiplomacyScreen}">
    <Style.Resources>
      <DataTemplate x:Key="StipulationTreeHeaderTemplate">
        <TextBlock Text="{Binding Path=Name, Converter={StaticResource UpperCaseConverter}}"
                   Foreground="{StaticResource HeaderTextBrush}"
                   FontFamily="{StaticResource ParagraphFont}"
                   Margin="0,8,0,0" />
      </DataTemplate>
      <DataTemplate x:Key="StipulationTreeItemTemplate">
        <TextBlock Foreground="{StaticResource DefaultTextBrush}"
                   FontFamily="{StaticResource ParagraphFont}"
                   Margin="8,4,0,0">
          <Hyperlink Command="{x:Static local:DiplomacyScreen.AddStipulationCommand}"
                     CommandParameter="{Binding}"
                     Foreground="{StaticResource DefaultTextBrush}">
            <TextBlock Text="{Binding Path=Value.ShortDescription}" />
          </Hyperlink>
        </TextBlock>
      </DataTemplate>
      <Style x:Key="SelectedSidebarButton"
             TargetType="{x:Type Button}">
        <Setter Property="FontFamily"
                Value="{StaticResource LCARS_DefaultFont}" />
        <Setter Property="FontSize"
                Value="16pt" />
        <Setter Property="ClipToBounds"
                Value="False" />
        <Setter Property="Focusable"
                Value="False" />
        <Setter Property="Margin"
                Value="0" />
        <Setter Property="BorderThickness"
                Value="0" />
        <Setter Property="BorderBrush"
                Value="{x:Null}" />
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type Button}">
              <Grid Opacity="{TemplateBinding Opacity}">
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="*" />
                  <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <ui:ButtonChrome x:Name="ButtonChrome"
                                 Background="{StaticResource LCARS_PinkGradient_Left_Right}"
                                 DisabledBackground="{StaticResource LCARS_PinkGradient_Left_Right}"
                                 HoverBackground="{StaticResource LCARS_PinkGradient_Left_Right}"
                                 PressedBackground="{StaticResource LCARS_PinkGradient_Right_Left}"
                                 RenderMouseOver="{TemplateBinding IsMouseOver}"
                                 RenderPressed="{TemplateBinding IsPressed}"
                                 BorderBrush="{x:Null}"
                                 Margin="0">
                  <Border x:Name="ContentBorder"
                          Grid.Column="0"
                          Background="{Binding ElementName=ButtonChrome, Path=RenderBackground}"
                          Margin="0,0,2,0"
                          Padding="16,2,16,2"
                          IsEnabled="True">
                    <ContentPresenter Content="{TemplateBinding Property=Content}"
                                      HorizontalAlignment="Center"
                                      VerticalAlignment="Center" />
                  </Border>
                </ui:ButtonChrome>
                <Rectangle Grid.Column="1"
                           Fill="{StaticResource LCARS_OrangeGradient_Left_Right}"
                           Width="12" />
              </Grid>
              <ControlTemplate.Triggers>
                <Trigger Property="IsEnabled"
                         Value="False">
                  <Setter Property="Opacity"
                          Value="1.0" />
                </Trigger>
              </ControlTemplate.Triggers>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </Style>
      <Style x:Key="SidebarButton"
             TargetType="{x:Type Button}">
        <Setter Property="FontFamily"
                Value="{StaticResource LCARS_DefaultFont}" />
        <Setter Property="FontSize"
                Value="16pt" />
        <Setter Property="ClipToBounds"
                Value="False" />
        <Setter Property="Focusable"
                Value="False" />
        <Setter Property="Margin"
                Value="0" />
        <Setter Property="BorderThickness"
                Value="0" />
        <Setter Property="BorderBrush"
                Value="{x:Null}" />
        <Setter Property="SnapsToDevicePixels"
                Value="True" />
        <Setter Property="Template">
          <Setter.Value>
            <ControlTemplate TargetType="{x:Type Button}">
              <Grid Opacity="{TemplateBinding Opacity}">
                <Grid.ColumnDefinitions>
                  <ColumnDefinition Width="*" />
                  <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <ui:ButtonChrome x:Name="ButtonChrome"
                                 Background="{StaticResource LCARS_BlueGradient_Left_Right}"
                                 DisabledBackground="{StaticResource LCARS_BlueGradient_Left_Right}"
                                 HoverBackground="{StaticResource LCARS_HoverBlueGradient_Left_Right}"
                                 PressedBackground="{StaticResource LCARS_BlueGradient_Right_Left}"
                                 RenderMouseOver="{TemplateBinding IsMouseOver}"
                                 RenderPressed="{TemplateBinding IsPressed}"
                                 BorderBrush="{x:Null}"
                                 Margin="0">
                  <Border x:Name="ContentBorder"
                          Grid.Column="0"
                          Background="{Binding ElementName=ButtonChrome, Path=RenderBackground}"
                          Margin="0,0,2,0"
                          Padding="16,2,16,2"
                          IsEnabled="True">
                    <ContentPresenter Content="{TemplateBinding Property=Content}"
                                      HorizontalAlignment="Center"
                                      VerticalAlignment="Center" />
                  </Border>
                </ui:ButtonChrome>
                <Rectangle Grid.Column="1"
                           Fill="{StaticResource LCARS_OrangeGradient_Left_Right}"
                           Width="12" />
              </Grid>
              <ControlTemplate.Triggers>
                <Trigger Property="IsEnabled"
                         Value="False">
                  <Setter Property="Opacity"
                          Value="1.0" />
                </Trigger>
              </ControlTemplate.Triggers>
            </ControlTemplate>
          </Setter.Value>
        </Setter>
      </Style>
    </Style.Resources>
    <Setter Property="Template">
      <Setter.Value>
        <ControlTemplate TargetType="{x:Type local:DiplomacyScreen}">
          <Grid SnapsToDevicePixels="True"
                Margin="6">
            <Grid.ColumnDefinitions>
              <ColumnDefinition Width="140" />
              <ColumnDefinition Width="28" />
              <ColumnDefinition Width="*" />
              <ColumnDefinition Width="28" />
              <ColumnDefinition Width="187" />
              <ColumnDefinition Width="28" />
              <ColumnDefinition Width="28" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
              <RowDefinition Height="56" />
              <RowDefinition Height="Auto" />
              <RowDefinition Height="*"
                             MinHeight="72"
                             MaxHeight="72" />
              <RowDefinition Height="Auto" />
              <RowDefinition Height="Auto" />
              <RowDefinition Height="Auto" />
              <RowDefinition Height="4*" />
              <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <!-- Upper Left Purple Corner -->
            <Path x:Name="UpperLeftCorner"
                  Grid.Column="0"
                  Grid.ColumnSpan="2"
                  Grid.Row="0"
                  Width="168"
                  Height="56"
                  Fill="{StaticResource LCARS_PurpleGradient_TopLeft_BottomRight}"
                  Data="F1 M 0,56L 0,24C 0,17.6348 2.52857,11.5303 7.02944,7.02944C 11.5303,2.52857 17.6348,0 24,0L 168,0L 168,28L 148,28C 143.582,28 140,31.5817 140,36L 140,56L 0,56 Z" />

            <!-- Upper Left Buttons -->
            <StackPanel x:Name="UpperLeftButtons"
                        Grid.Column="0"
                        Grid.Row="1"
                        Orientation="Vertical"
                        Margin="0,2,0,0">
              <Button x:Name="PART_ViewButton_Overview"
                      Style="{StaticResource SidebarButton}"
                      Content="OVERVIEW"
                      Command="{x:Static local:DiplomacyScreen.SetCurrentViewCommand}"
                      CommandParameter="{x:Static local:DiplomacyScreenViewType.Overview}" />
              <Button x:Name="PART_ViewButton_Agreements"
                      Style="{StaticResource SidebarButton}"
                      Content="AGREEMENTS"
                      Command="{x:Static local:DiplomacyScreen.SetCurrentViewCommand}"
                      CommandParameter="{x:Static local:DiplomacyScreenViewType.Agreements}"
                      Margin="0,2,0,0" />
              <Button x:Name="PART_ViewButton_Inbox"
                      Style="{StaticResource SidebarButton}"
                      Content="INBOX"
                      Command="{x:Static local:DiplomacyScreen.SetCurrentViewCommand}"
                      CommandParameter="{x:Static local:DiplomacyScreenViewType.Inbox}"
                      Margin="0,2,0,0" />
              <Button x:Name="PART_ViewButton_Outbox"
                      Style="{StaticResource SidebarButton}"
                      Content="OUTBOX"
                      Command="{x:Static local:DiplomacyScreen.SetCurrentViewCommand}"
                      CommandParameter="{x:Static local:DiplomacyScreenViewType.Outbox}"
                      Margin="0,2,0,0" />
            </StackPanel>

            <!-- Upper Left Side -->
            <Grid x:Name="UpperLeftSide"
                  Grid.Column="0"
                  Grid.Row="2"
                  Height="112"
                  Margin="0,2,0,0">
              <Border Background="{StaticResource LCARS_OrangeGradient_TopLeft_BottomRight}"
                      BorderThickness="0"
                      Width="69"
                      Height="Auto"
                      HorizontalAlignment="Left" />
              <Border Background="{StaticResource LCARS_OrangeGradient_TopLeft_BottomRight}"
                      BorderThickness="0"
                      Width="69"
                      Height="Auto"
                      HorizontalAlignment="Right" />
            </Grid>

            <!-- Lower-Upper Left Purple Corner -->
            <Path x:Name="LowerUpperLeftCorner"
                  Grid.Column="0"
                  Grid.ColumnSpan="2"
                  Grid.Row="3"
                  Width="168"
                  Height="40"
                  Fill="{StaticResource LCARS_PurpleGradient_TopLeft_BottomRight}"
                  Margin="0,2,0,0"
                  Data="F1 M 0,0L 0,16C 0,22.3652 2.52857,28.4697 7.02944,32.9706C 11.5303,37.4714 17.6348,40 24,40L 168,40L 168,27.0263L 148,27.0263C 143.582,27.0263 140,23.4446 140,19.0263L 140,0L 0,0 Z" />

            <!-- Upper-Lower Left Purple Corner -->
            <Path x:Name="UpperLowerLeftCorner"
                  Grid.Column="0"
                  Grid.ColumnSpan="2"
                  Grid.Row="4"
                  Width="168"
                  Height="40"
                  Fill="{StaticResource LCARS_PurpleGradient_TopLeft_BottomRight}"
                  Margin="0,2,0,0"
                  Data="F1 M 0,40L 0,24C 0,17.6348 2.52857,11.5303 7.02944,7.02944C 11.5303,2.52857 17.6348,0 24,0L 168,0L 168,12.9737L 148,12.9737C 143.582,12.9737 140,16.5554 140,20.9737L 140,40L 0,40 Z" />

            <!-- Lower Left Buttons -->
            <StackPanel x:Name="InboxButtons"
                        Grid.Column="0"
                        Grid.Row="5"
                        Orientation="Vertical"
                        Margin="0,2,0,0"
                        Visibility="Collapsed">
              <Button Content="ACCEPT"
                      Style="{StaticResource SidebarButton}"
                      Command="{x:Static local:DiplomacyScreen.AcceptProposalCommand}" />
              <Button x:Name="CounterButton"
                      Content="COUNTER"
                      Style="{StaticResource SidebarButton}"
                      Command="{x:Static local:DiplomacyScreen.CounterProposalCommand}"
                      Margin="0,2,0,0"
                      Visibility="Collapsed" />
              <Button Content="REJECT"
                      Style="{StaticResource SidebarButton}"
                      Command="{x:Static local:DiplomacyScreen.RejectProposalCommand}"
                      Margin="0,2,0,0" />
            </StackPanel>
            <StackPanel x:Name="OutboxButtons"
                        Grid.Column="0"
                        Grid.Row="5"
                        Orientation="Vertical"
                        Margin="0,2,0,0"
                        Visibility="Collapsed">
              <Button x:Name="CommendButton"
                      Style="{StaticResource SidebarButton}"
                      Content="COMMEND"
                      Command="{x:Static local:DiplomacyScreen.CommendCommand}" />
              <Button x:Name="DenounceButton"
                      Style="{StaticResource SidebarButton}"
                      Content="DENOUNCE"
                      Margin="0,2,0,0"
                      Command="{x:Static local:DiplomacyScreen.DenounceCommand}" />
              <Button x:Name="ThreatButton"
                      Style="{StaticResource SidebarButton}"
                      Content="ISSUE THREAT"
                      Margin="0,2,0,0"
                      Command="{x:Static local:DiplomacyScreen.IssueThreatCommand}" />
              <Button x:Name="ProposalButton"
                      Style="{StaticResource SidebarButton}"
                      Content="MAKE PROPOSAL"
                      Margin="0,2,0,0"
                      Command="{x:Static local:DiplomacyScreen.MakeProposalCommand}" />
              <Button x:Name="DeclareWarButton"
                      Style="{StaticResource SidebarButton}"
                      Content="DECLARE WAR"
                      Margin="0,2,0,0"
                      Command="{x:Static local:DiplomacyScreen.DeclareWarCommand}" />
            </StackPanel>
            <StackPanel x:Name="DraftButtons"
                        Grid.Column="0"
                        Grid.Row="5"
                        Orientation="Vertical"
                        Margin="0,2,0,0"
                        Visibility="Collapsed">
              <Button Style="{StaticResource SidebarButton}"
                      Content="SEND"
                      Command="{x:Static local:DiplomacyScreen.SendMessageCommand}" />
              <Button Style="{StaticResource SidebarButton}"
                      Content="EDIT"
                      Margin="0,2,0,0"
                      Command="{x:Static local:DiplomacyScreen.EditMessageCommand}" />
              <Button Style="{StaticResource SidebarButton}"
                      Content="CANCEL"
                      Margin="0,2,0,0"
                      Command="{x:Static local:DiplomacyScreen.CancelMessageCommand}" />
            </StackPanel>

            <!-- Lower Left Side -->
            <DockPanel x:Name="LowerLeftSide"
                       Grid.Column="0"
                       Grid.Row="6"
                       Margin="0,2,0,0">
              <Border Background="{StaticResource LCARS_OrangeGradient_TopLeft_BottomRight}"
                      Width="69" />
              <Border Background="{StaticResource LCARS_OrangeGradient_TopLeft_BottomRight}"
                      Width="69"
                      Margin="2,0,0,0" />
            </DockPanel>

            <!-- Lower Left Purple Corner -->
            <Path x:Name="LowerLeftCorner"
                  Grid.Column="0"
                  Grid.ColumnSpan="2"
                  Grid.Row="7"
                  Width="168"
                  Height="56"
                  Fill="{StaticResource LCARS_PurpleGradient_TopLeft_BottomRight}"
                  Margin="0,2,0,0"
                  Data="F1 M 0,0L 0,32C 0,38.3652 2.52857,44.4697 7.02944,48.9706C 11.5303,53.4714 17.6348,56 24,56L 168,56L 168,28L 148,28C 143.582,28 140,24.4183 140,20L 140,0L 0,0 Z" />

            <!-- Upper Horizontal Divider -->
            <Border x:Name="UpperHorizontalDivider"
                    Grid.Column="2"
                    Grid.Row="0"
                    Background="{StaticResource LCARS_BlueGradient_Top_Bottom}"
                    Height="28"
                    Margin="2,0,2,0"
                    VerticalAlignment="Top"
                    Grid.ColumnSpan="3"
                    Visibility="Hidden" />

            <!-- Upper-Middle Left Horizontal Divider -->
            <Border x:Name="UpperMiddleLeftHorizontalDivider"
                    Grid.Column="2"
                    Grid.Row="3"
                    Background="{StaticResource LCARS_BlueGradient_Top_Bottom}"
                    Height="13"
                    Margin="2,0,2,0"
                    VerticalAlignment="Bottom" />

            <!-- Lower-Middle Left Horizontal Divider -->
            <Border x:Name="LowerMiddleLeftHorizontalDivider"
                    Grid.Column="2"
                    Grid.Row="4"
                    Background="{StaticResource LCARS_BlueGradient_Top_Bottom}"
                    Height="13"
                    Margin="2,2,2,0"
                    VerticalAlignment="Top" />

            <!-- Upper-Middle Right Horizontal Divider -->
            <Border x:Name="UpperMiddleRightHorizontalDivider"
                    Grid.Column="4"
                    Grid.Row="3"
                    Background="{StaticResource LCARS_BlueGradient_Top_Bottom}"
                    Height="13"
                    Margin="2,0,2,0"
                    VerticalAlignment="Bottom" />

            <!-- Lower-Middle Right Horizontal Divider -->
            <Border x:Name="LowerMiddleRightHorizontalDivider"
                    Grid.Column="4"
                    Grid.Row="4"
                    Background="{StaticResource LCARS_BlueGradient_Top_Bottom}"
                    Height="13"
                    Margin="2,2,2,0"
                    VerticalAlignment="Top" />

            <!-- Lower-Middle Splitter Column -->
            <Path x:Name="UpperCenterDivider"
                  Grid.Column="3"
                  Grid.Row="3"
                  Grid.RowSpan="2"
                  Width="28"
                  Height="42"
                  Fill="{StaticResource LCARS_PurpleGradient_TopLeft_BottomRight}"
                  Margin="0,0,0,13"
                  VerticalAlignment="Bottom"
                  Data="F1 M 0,0L 0,27.9954C 1.85621,27.9954 3.6364,28.7328 4.94894,30.0454C 6.26148,31.3579 6.99886,33.1381 6.99886,34.9943L 6.99886,41.9932L 20.9966,41.9932L 20.9966,34.9943C 20.9966,33.1381 21.734,31.3579 23.0465,30.0454C 24.359,28.7328 26.1392,27.9954 27.9954,27.9954L 27.9954,0L 0,0 Z" />
            <Border x:Name="MiddleCenterDivider"
                    Grid.Column="3"
                    Grid.Row="4"
                    Grid.RowSpan="4"
                    Background="{StaticResource LCARS_OrangeGradient_Left_Right}"
                    Width="14"
                    Margin="0,31,0,44" />
            <Path x:Name="LowerCenterDivider"
                  Grid.Column="3"
                  Grid.Row="7"
                  Width="28"
                  Height="42"
                  Fill="{StaticResource LCARS_PurpleGradient_TopLeft_BottomRight}"
                  Margin="0,0,0,0"
                  VerticalAlignment="Bottom"
                  Data="F1M0,41.9932L0,13.9977C1.85621,13.9977 3.6364,13.2603 4.94894,11.9478 6.26148,10.6353 6.99886,8.85507 6.99886,6.99886L6.99886,0 20.9966,0 20.9966,6.99886C20.9966,8.85508 21.734,10.6353 23.0465,11.9478 24.359,13.2603 26.1392,13.9977 27.9954,13.9977L27.9954,41.9932 0,41.9932z" />

            <!-- Lower-Left Horizontal Divider -->
            <Border x:Name="LowerLeftHorizontalDivider"
                    Grid.Column="2"
                    Grid.Row="7"
                    Background="{StaticResource LCARS_BlueGradient_Top_Bottom}"
                    Height="28"
                    Margin="2,0,2,0"
                    VerticalAlignment="Bottom" />

            <!-- Lower-Right Horizontal Divider -->
            <Border x:Name="LowerRightHorizontalDivider"
                    Grid.Column="4"
                    Grid.Row="7"
                    Background="{StaticResource LCARS_BlueGradient_Top_Bottom}"
                    Height="28"
                    Margin="2,0,2,0"
                    VerticalAlignment="Bottom" />

            <!-- Upper Right Purple Corner -->
            <Path x:Name="UpperRightCorner"
                  Grid.Column="5"
                  Grid.ColumnSpan="2"
                  Grid.Row="0"
                  Width="56"
                  Height="56"
                  Fill="{StaticResource LCARS_PurpleGradient_TopLeft_BottomRight}"
                  Data="F1 M 0,0L 28,0C 35.4261,0 42.548,2.94999 47.799,8.20101C 53.05,13.452 56,20.5739 56,28L 56,56L 28,56L 28,35.7251C 28,33.6282 27.1481,31.6212 25.6396,30.1646C 24.1312,28.708 22.0957,27.9267 20,28L 0,28L 0,0 Z" />

            <!-- Lower-Upper Right Purple Corner -->
            <Path x:Name="LowerUpperRightCorner"
                  Grid.Column="5"
                  Grid.ColumnSpan="2"
                  Grid.Row="3"
                  Width="56"
                  Height="40"
                  Fill="{StaticResource LCARS_PurpleGradient_TopLeft_BottomRight}"
                  Margin="0,2,0,0"
                  Data="F1 M 0,40L 40,40C 48.8366,40 56,32.8366 56,24L 56,0L 28,0L 28,19C 28,23.4183 24.4183,27 20,27L 0,27L 0,40 Z" />

            <!-- Upper-Lower Right Purple Corner -->
            <Path x:Name="UpperLowerRightCorner"
                  Grid.Column="5"
                  Grid.ColumnSpan="2"
                  Grid.Row="4"
                  Width="168"
                  Height="40"
                  Fill="{StaticResource LCARS_PurpleGradient_TopLeft_BottomRight}"
                  Margin="0,2,0,0"
                  Data="F1 M 0,0L 40,0C 48.8366,0 56,7.16344 56,16L 56,40L 28,40L 28,21C 28,16.5817 24.4183,13 20,13L 0,13L 0,0 Z" />

            <!-- Upper Right Side -->
            <Border x:Name="UpperRightSide"
                    Grid.Column="6"
                    Grid.Row="1"
                    Grid.RowSpan="2"
                    Background="{StaticResource LCARS_OrangeGradient_Left_Right}"
                    Height="Auto"
                    Margin="0,2,0,0" />

            <!-- Lower Right Side -->
            <Border x:Name="LowerRightSide"
                    Grid.Column="6"
                    Grid.Row="5"
                    Grid.RowSpan="3"
                    Background="{StaticResource LCARS_OrangeGradient_Left_Right}"
                    Height="Auto"
                    Margin="0,2,0,50" />

            <!-- Lower Right Purple Corner -->
            <Path x:Name="LowerRightCorner"
                  Grid.Column="5"
                  Grid.ColumnSpan="2"
                  Grid.Row="7"
                  Width="56"
                  Height="48"
                  Fill="{StaticResource LCARS_PurpleGradient_TopLeft_BottomRight}"
                  Margin="0,2,0,0"
                  VerticalAlignment="Bottom"
                  Data="F1 M 0,48L 28,48C 35.4261,48 42.548,45.05 47.799,39.799C 53.05,34.548 56,27.4261 56,20L 56,0L 28,0L 28,12.2749C 28,14.3718 27.1481,16.3788 25.6396,17.8354C 24.1312,19.292 22.0957,20.0733 20,20L 0,20L 0,48 Z" />

            <Grid x:Name="GraphContainer"
                  Grid.Column="2"
                  Grid.ColumnSpan="3"
                  Grid.Row="1"
                  Grid.RowSpan="6"
                  Visibility="Hidden">
              <Viewbox Stretch="Uniform"
                       StretchDirection="Both"
                       SnapsToDevicePixels="True">
                <ui:NodeGraph x:Name="PART_CivRelationshipGraph"
                              CoefficientOfDampening="1.0"
                              FrameRate="0.5"
                              Width="800px"
                              Height="640px" />
              </Viewbox>
              <Button Content="{s:StringResource Key=RESET_GRAPH, Case=Upper}"
                      Command="{x:Static local:DiplomacyScreen.ResetDiplomacyGraphCommand}"
                      Style="{StaticResource LCARS_StandardButtonStyle}"
                      Height="28"
                      HorizontalAlignment="Right"
                      VerticalAlignment="Bottom"
                      Margin="16" />
            </Grid>

            <Grid Grid.Column="2"
                  Grid.ColumnSpan="3"
                  Grid.Row="0"
                  Grid.RowSpan="3"
                  Margin="2,0,2,0">
              <Grid.Resources>
                <DataTemplate x:Key="BoolCellEditor">
                  <TextBlock x:Name="ValueText"
                             Text="No"
                             Foreground="Crimson" />
                  <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding}"
                                 Value="True">
                      <Setter TargetName="ValueText"
                              Property="TextBlock.Text"
                              Value="Yes" />
                      <Setter TargetName="ValueText"
                              Property="TextBlock.Foreground"
                              Value="Lime" />
                    </DataTrigger>
                  </DataTemplate.Triggers>
                </DataTemplate>
              </Grid.Resources>

              <xcdg:DataGridControl x:Name="PART_CivilizationList"
                                    Background="Transparent"
                                    Foreground="{StaticResource DefaultTextBrush}"
                                    BorderBrush="{x:Null}"
                                    BorderThickness="0"
                                    ReadOnly="True"
                                    SelectionMode="Single"
                                    ItemsSource="{Binding}"
                                    AutoCreateColumns="False"
                                    HorizontalContentAlignment="Stretch"
                                    HorizontalAlignment="Stretch"
                                    Focusable="True"
                                    xcdg:Cell.IsCellFocusScope="False"
                                    KeyboardNavigation.TabNavigation="None"
                                    KeyboardNavigation.DirectionalNavigation="Cycle"
                                    KeyboardNavigation.ControlTabNavigation="None"
                                    KeyboardNavigation.AcceptsReturn="False">
                <xcdg:DataGridControl.Columns>
                  <xcdg:Column FieldName="OtherCiv.LongName"
                               Title="CIVILIZATION"
                               Width="200"
                               DisplayMemberBinding="{Binding Path=OtherCiv.LongName, Mode=OneWay, FallbackValue={x:Static sys:String.Empty}}"
                               IsMainColumn="True"
                               VisiblePosition="0" />
                  <xcdg:Column FieldName="Status"
                               Title="STATUS"
                               ReadOnly="True"
                               VisiblePosition="1">
                    <xcdg:Column.CellContentTemplate>
                      <DataTemplate>
                        <TextBlock Text="{Binding Mode=OneWay, Converter={StaticResource EnumStringConverter}, ConverterParameter=RelationshipStatus, FallbackValue={x:Static sys:String.Empty}}"
                                   Foreground="{Binding Mode=OneWay, Converter={StaticResource RelationshipStatusBrushConverter}}" />
                      </DataTemplate>
                    </xcdg:Column.CellContentTemplate>
                  </xcdg:Column>
                  <xcdg:Column FieldName="TurnsSinceStatusChange"
                               Title="TURNS"
                               Width="96"
                               DisplayMemberBinding="{Binding Path=TurnsSinceStatusChange, Mode=OneWay, FallbackValue={x:Static sys:String.Empty}}"
                               VisiblePosition="2" />
                  <xcdg:Column FieldName="Demeanor"
                               Title="ATTITUDE"
                               DisplayMemberBinding="{Binding Path=Demeanor, Mode=OneWay, FallbackValue={x:Static sys:String.Empty}}"
                               VisiblePosition="3" />
                  <xcdg:Column FieldName="OutgoingMessage"
                               Title="OUTGOING MESSAGE"
                               Width="200"
                               ReadOnly="True"
                               VisiblePosition="4">
                    <xcdg:Column.DisplayMemberBinding>
                      <MultiBinding Converter="{StaticResource NonNullValueConverter}"
                                    FallbackValue="{x:Static sys:String.Empty}">
                        <MultiBinding.Bindings>
                          <Binding Path="Outbox.MessageTypeDescription" />
                          <Binding Path="ReplyOutbox.MessageTypeDescription" />
                        </MultiBinding.Bindings>
                      </MultiBinding>
                    </xcdg:Column.DisplayMemberBinding>
                  </xcdg:Column>
                </xcdg:DataGridControl.Columns>
                <xcdg:DataGridControl.View>
                  <xcdg:TableView ShowFixedColumnSplitter="False"
                                  ShowRowSelectorPane="False"
                                  xcdg:GroupLevelIndicatorPane.ShowIndicators="False"
                                  HorizontalGridLineThickness="0"
                                  HorizontalGridLineBrush="Transparent"
                                  VerticalGridLineThickness="0"
                                  VerticalGridLineBrush="Transparent">
                    <xcdg:TableView.FixedHeaders>
                      <xcdg:ClearHeadersFooters />
                      <!--<DataTemplate>
                        <xcdg:GroupByControl AllowSort="False"
                                             AllowGroupingModification="False" />
                      </DataTemplate>-->
                      <DataTemplate>
                        <xcdg:ColumnManagerRow AllowSort="True"
                                               AllowColumnReorder="True" />
                      </DataTemplate>
                    </xcdg:TableView.FixedHeaders>
                  </xcdg:TableView>
                </xcdg:DataGridControl.View>
              </xcdg:DataGridControl>

              <xcdg:DataGridControl x:Name="PART_IncomingMessageList"
                                    Background="Transparent"
                                    Foreground="{StaticResource DefaultTextBrush}"
                                    BorderBrush="{x:Null}"
                                    BorderThickness="0"
                                    ReadOnly="True"
                                    SelectionMode="Single"
                                    ItemsSource="{Binding}"
                                    AutoCreateColumns="False"
                                    HorizontalContentAlignment="Stretch"
                                    HorizontalAlignment="Stretch"
                                    Visibility="Collapsed"
                                    Focusable="True"
                                    xcdg:Cell.IsCellFocusScope="False"
                                    KeyboardNavigation.TabNavigation="None"
                                    KeyboardNavigation.DirectionalNavigation="Cycle"
                                    KeyboardNavigation.ControlTabNavigation="None"
                                    KeyboardNavigation.AcceptsReturn="False">
                <xcdg:DataGridControl.Columns>
                  <xcdg:Column FieldName="Sender.LongName"
                               Title="CIVILIZATION"
                               Width="240"
                               DisplayMemberBinding="{Binding Path=Sender.LongName, Mode=OneWay, FallbackValue={x:Static sys:String.Empty}}"
                               VisiblePosition="0"
                               IsMainColumn="True" />
                  <xcdg:Column FieldName="MessageTypeDescription"
                               Title="INCOMING MESSAGE"
                               Width="240"
                               DisplayMemberBinding="{Binding Path=MessageTypeDescription, Mode=OneWay, FallbackValue={x:Static sys:String.Empty}}"
                               VisiblePosition="1" />
                </xcdg:DataGridControl.Columns>
                <xcdg:DataGridControl.View>
                  <xcdg:TableView ShowFixedColumnSplitter="False"
                                  ShowRowSelectorPane="False"
                                  xcdg:GroupLevelIndicatorPane.ShowIndicators="False"
                                  HorizontalGridLineThickness="0"
                                  HorizontalGridLineBrush="Transparent"
                                  VerticalGridLineThickness="0"
                                  VerticalGridLineBrush="Transparent">
                    <xcdg:TableView.FixedHeaders>
                      <xcdg:ClearHeadersFooters />
                      <!--<DataTemplate>
                        <xcdg:GroupByControl AllowSort="False"
                                             AllowGroupingModification="False" />
                      </DataTemplate>-->
                      <DataTemplate>
                        <xcdg:ColumnManagerRow AllowSort="True"
                                               AllowColumnReorder="True" />
                      </DataTemplate>
                    </xcdg:TableView.FixedHeaders>
                  </xcdg:TableView>
                </xcdg:DataGridControl.View>
              </xcdg:DataGridControl>

            </Grid>

            <!--<ListView x:Name="PART_CivilizationList2"
                      Grid.Column="2"
                      Grid.ColumnSpan="3"
                      Grid.Row="0"
                      Grid.RowSpan="3"
                      Background="Transparent"
                      BorderBrush="{x:Null}"
                      BorderThickness="0"
                      ClipToBounds="True"
                      Margin="0,0,2,0"
                      Foreground="{StaticResource DefaultTextBrush}"
                      ItemsSource="{Binding}"
                      IsSynchronizedWithCurrentItem="True"
                      ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                      Visibility="Collapsed">
              <ListView.View>
                <GridView>
                  <GridView.Columns>
                    <GridViewColumn Header="Civilization"
                                    DisplayMemberBinding="{Binding Path=OtherCiv.LongName}"
                                    Width="320" />
                    <GridViewColumn Header="Status"
                                    DisplayMemberBinding="{Binding Path=Status}" />
                    <GridViewColumn Header="Status Duration" Width="4096">
                      <GridViewColumn.CellTemplate>
                        <DataTemplate>
                          <WrapPanel Orientation="Horizontal"
                                     VerticalAlignment="Center">
                            <TextBlock Text="{Binding Path=TurnsSinceStatusChange}"
                                       TextWrapping="Wrap"
                                       TextTrimming="CharacterEllipsis" />
                            <TextBlock Text=" Turns"
                                       TextWrapping="Wrap"
                                       TextTrimming="CharacterEllipsis" />
                          </WrapPanel>
                        </DataTemplate>
                      </GridViewColumn.CellTemplate>
                    </GridViewColumn>
                  </GridView.Columns>
                </GridView>
              </ListView.View>
            </ListView>-->

            <!--<ListView x:Name="PART_IncomingMessageList"
                      Grid.Column="2"
                      Grid.ColumnSpan="3"
                      Grid.Row="0"
                      Grid.RowSpan="3"
                      Background="Transparent"
                      BorderBrush="{x:Null}"
                      BorderThickness="0"
                      ClipToBounds="True"
                      Margin="0,0,2,0"
                      Foreground="{StaticResource DefaultTextBrush}"
                      ItemsSource="{Binding}"
                      IsSynchronizedWithCurrentItem="True"
                      Visibility="Collapsed"
                      ScrollViewer.HorizontalScrollBarVisibility="Disabled">
              <ListView.View>
                <GridView>
                  <GridView.Columns>
                    <GridViewColumn Header="Civilization"
                                    DisplayMemberBinding="{Binding Path=Sender.LongName}"
                                    Width="320" />
                    <GridViewColumn Header="Summary"
                                    DisplayMemberBinding="{Binding Path=MessageType}"
                                    Width="4096" />
                  </GridView.Columns>
                </GridView>
              </ListView.View>
            </ListView>-->

            <Border x:Name="ActiveAgreementsPanel"
                    Grid.Column="2"
                    Grid.Row="5"
                    Grid.RowSpan="2"
                    Visibility="Collapsed"
                    Margin="-14,-14,0,-14">
              <ScrollViewer HorizontalScrollBarVisibility="Disabled"
                            VerticalScrollBarVisibility="Auto">
                <DockPanel LastChildFill="True"
                           Margin="0,0,7,0">
                  <Border DockPanel.Dock="Top"
                          Margin="0,0,0,14"
                          Background="{StaticResource CommBackgroundBrush}"
                          BorderBrush="{StaticResource CommBorderBrush}"
                          BorderThickness="2"
                          CornerRadius="8"
                          Padding="6">
                    <DockPanel LastChildFill="True">
                      <Image DockPanel.Dock="Left"
                             VerticalAlignment="Center"
                             Width="64"
                             Height="64"
                             Stretch="Uniform"
                             StretchDirection="Both"
                             Source="{Binding Path=CurrentRelationship.OtherCiv, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:DiplomacyScreen}}, Converter={StaticResource CivInsigniaConverter}}" />
                      <Image DockPanel.Dock="Right"
                             VerticalAlignment="Center"
                             Width="64"
                             Height="64"
                             Stretch="Uniform"
                             StretchDirection="Both"
                             Source="{Binding Path=CurrentRelationship.OwnerCiv, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:DiplomacyScreen}}, Converter={StaticResource CivInsigniaConverter}}" />
                      <TextBlock TextAlignment="Center"
                                 VerticalAlignment="Center"
                                 TextWrapping="Wrap"
                                 TextTrimming="CharacterEllipsis"
                                 FontSize="28pt"
                                 FontFamily="{StaticResource DefaultFont}"
                                 Foreground="{StaticResource HeaderTextBrush}"
                                 Margin="7,0,7,0">
                        <TextBlock Text="THE EMBASSY OF THE " />
                        <TextBlock Text="{Binding Path=CurrentRelationship.OtherCiv.ShortName, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:DiplomacyScreen}}, Converter={StaticResource UpperCaseConverter}}" />
                        <TextBlock Text=" TO THE " />
                        <TextBlock Text="{Binding Path=CurrentRelationship.OwnerCiv.ShortName, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:DiplomacyScreen}}, Converter={StaticResource UpperCaseConverter}}" />
                      </TextBlock>
                    </DockPanel>
                  </Border>
                  <Border Background="{StaticResource CommBackgroundBrush}"
                          BorderBrush="{StaticResource CommBorderBrush}"
                          BorderThickness="2"
                          CornerRadius="8"
                          Padding="6"
                          TextBlock.FontFamily="{StaticResource ParagraphFont}"
                          TextBlock.FontSize="12pt">
                    <StackPanel Orientation="Vertical">
                      <TextBlock TextAlignment="Center"
                                 TextWrapping="Wrap"
                                 TextTrimming="CharacterEllipsis"
                                 FontSize="28pt"
                                 FontFamily="{StaticResource DefaultFont}"
                                 Foreground="{StaticResource HeaderTextBrush}"
                                 Margin="0,0,0,8"
                                 Text="ACTIVE AGREEMENTS" />
                      <ItemsControl ItemsSource="{Binding Path=CurrentRelationship.ActiveAgreements, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:DiplomacyScreen}}}"
                                    ItemTemplate="{StaticResource AgreementItemTemplate}" />
                    </StackPanel>
                  </Border>
                </DockPanel>
              </ScrollViewer>
            </Border>

            <Border x:Name="MessagePanel"
                    Grid.Column="2"
                    Grid.Row="5"
                    Grid.RowSpan="2"
                    Visibility="Visible"
                    Margin="-14,-14,0,-14"
                    DataContext="{Binding Path=CurrentMessage, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:DiplomacyScreen}}}">
              <ScrollViewer HorizontalScrollBarVisibility="Disabled"
                            VerticalScrollBarVisibility="Auto">
                <DockPanel LastChildFill="True"
                           Margin="0,0,7,0">
                  <Border DockPanel.Dock="Top"
                          Margin="0,0,0,14"
                          Background="{StaticResource CommBackgroundBrush}"
                          BorderBrush="{StaticResource CommBorderBrush}"
                          BorderThickness="2"
                          CornerRadius="8"
                          Padding="6">
                    <DockPanel LastChildFill="True">
                      <Image DockPanel.Dock="Left"
                             VerticalAlignment="Center"
                             Width="64"
                             Height="64"
                             Stretch="Uniform"
                             StretchDirection="Both"
                             Source="{Binding Path=CurrentRelationship.OtherCiv, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:DiplomacyScreen}}, Converter={StaticResource CivInsigniaConverter}}" />
                      <Image DockPanel.Dock="Right"
                             VerticalAlignment="Center"
                             Width="64"
                             Height="64"
                             Stretch="Uniform"
                             StretchDirection="Both"
                             Source="{Binding Path=CurrentRelationship.OwnerCiv, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:DiplomacyScreen}}, Converter={StaticResource CivInsigniaConverter}}" />
                      <TextBlock TextAlignment="Center"
                                 VerticalAlignment="Center"
                                 TextWrapping="Wrap"
                                 TextTrimming="CharacterEllipsis"
                                 FontSize="28pt"
                                 FontFamily="{StaticResource DefaultFont}"
                                 Foreground="{StaticResource HeaderTextBrush}"
                                 Margin="7,0,7,0">
                        <TextBlock Text="THE EMBASSY OF THE " />
                        <TextBlock Text="{Binding Path=CurrentRelationship.OtherCiv.ShortName, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:DiplomacyScreen}}, Converter={StaticResource UpperCaseConverter}}" />
                        <TextBlock Text=" TO THE " />
                        <TextBlock Text="{Binding Path=CurrentRelationship.OwnerCiv.ShortName, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type local:DiplomacyScreen}}, Converter={StaticResource UpperCaseConverter}}" />
                      </TextBlock>
                    </DockPanel>
                  </Border>
                  <Border x:Name="StipulationListBorder"
                          DockPanel.Dock="Left"
                          Width="220"
                          Margin="0,-8,8,0"
                          Padding="7"
                          Background="{StaticResource CommBackgroundBrush}"
                          BorderBrush="{StaticResource CommBorderBrush}"
                          BorderThickness="2"
                          CornerRadius="8"
                          Visibility="Collapsed">
                    <ItemsControl x:Name="PART_StipulationList"
                                  Background="Transparent"
                                  BorderBrush="{x:Null}"
                                  BorderThickness="0"
                                  Foreground="{StaticResource DefaultTextBrush}"
                                  FontFamily="{StaticResource ParagraphFont}"
                                  FontSize="12pt"
                                  ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                                  ScrollViewer.VerticalScrollBarVisibility="Auto"
                                  ItemTemplate="{StaticResource StipulationTreeItemTemplate}">
                      <ItemsControl.GroupStyle>
                        <GroupStyle HeaderTemplate="{StaticResource StipulationTreeHeaderTemplate}" />
                      </ItemsControl.GroupStyle>
                    </ItemsControl>
                  </Border>
                  <Border x:Name="PART_CommDetailsBorder"
                          Padding="7"
                          Background="{StaticResource CommBackgroundBrush}"
                          BorderBrush="{StaticResource CommBorderBrush}"
                          BorderThickness="2"
                          CornerRadius="8"
                          Margin="0,-8,0,0">
                    <StackPanel Orientation="Vertical">
                      <TextBlock x:Name="PART_CommDetailsHeading"
                                 TextAlignment="Center"
                                 TextWrapping="Wrap"
                                 TextTrimming="CharacterEllipsis"
                                 FontSize="28pt"
                                 FontFamily="{StaticResource DefaultFont}"
                                 Foreground="{StaticResource HeaderTextBrush}"
                                 Margin="0,0,0,8" />
                      <ContentPresenter x:Name="PART_MessageTextPresenter"
                                        TextBlock.Foreground="{StaticResource DefaultTextBrush}"
                                        TextBlock.FontFamily="{StaticResource ParagraphFont}"
                                        TextBlock.FontSize="16"
                                        Margin="0,8,0,8" />
                      <StackPanel Orientation="Vertical">
                        <StackPanel.Resources>
                          <Style TargetType="{x:Type Button}">
                            <Setter Property="Width"
                                    Value="21" />
                            <Setter Property="Height"
                                    Value="21" />
                            <Setter Property="Focusable"
                                    Value="False" />
                            <Setter Property="Template">
                              <Setter.Value>
                                <ControlTemplate TargetType="{x:Type Button}">
                                  <Border x:Name="ButtonBorder"
                                          Background="{StaticResource LCARS_BlueGradient_Top_Bottom}"
                                          CornerRadius="8"
                                          Width="16"
                                          Height="16">
                                    <Canvas Width="16"
                                            Height="16">
                                      <Path Canvas.Left="0"
                                            Canvas.Top="0"
                                            Width="16"
                                            Height="16"
                                            Stretch="None"
                                            StrokeThickness="2.0"
                                            StrokeStartLineCap="Round"
                                            StrokeEndLineCap="Round"
                                            StrokeMiterLimit="2"
                                            Stroke="#FF000000"
                                            Data="F1 M 5.67,5.67L 11.33,11.33" />
                                      <Path Canvas.Left="0"
                                            Canvas.Top="0"
                                            Width="21"
                                            Height="21"
                                            Stretch="None"
                                            StrokeThickness="2.0"
                                            StrokeStartLineCap="Round"
                                            StrokeEndLineCap="Round"
                                            StrokeMiterLimit="2"
                                            Stroke="#FF000000"
                                            Data="F1 M 11.33,5.67L 5.67,11.33" />
                                    </Canvas>
                                  </Border>
                                  <ControlTemplate.Triggers>
                                    <Trigger Property="IsMouseOver"
                                             Value="True">
                                      <Setter TargetName="ButtonBorder"
                                              Property="Background"
                                              Value="{StaticResource LCARS_HoverBlueGradient_Top_Bottom}" />
                                    </Trigger>
                                    <Trigger Property="IsPressed"
                                             Value="True">
                                      <Setter TargetName="ButtonBorder"
                                              Property="Background"
                                              Value="{StaticResource LCARS_BlueGradient_Bottom_Top}" />
                                    </Trigger>
                                  </ControlTemplate.Triggers>
                                </ControlTemplate>
                              </Setter.Value>
                            </Setter>
                          </Style>
                        </StackPanel.Resources>
                        <ItemsControl x:Name="PART_MutualStipulationList"
                                      Margin="0,8,0,8"
                                      HorizontalContentAlignment="Center"
                                      Foreground="DeepSkyBlue"
                                      FontFamily="{StaticResource ParagraphFont}"
                                      FontSize="16">
                          <ItemsControl.Resources>
                            <Style TargetType="{x:Type Hyperlink}"
                                   BasedOn="{StaticResource {x:Type Hyperlink}}">
                              <Setter Property="TextElement.Foreground">
                                <Setter.Value>
                                  <SolidColorBrush Color="{Binding Source={x:Static Colors.DeepSkyBlue}, BindsDirectlyToSource=True, Converter={StaticResource LightColorConverter}}" />
                                </Setter.Value>
                              </Setter>
                            </Style>
                          </ItemsControl.Resources>
                        </ItemsControl>
                        <ContentPresenter x:Name="PART_ProposalOffersLeadInPresenter"
                                          TextBlock.Foreground="{StaticResource DefaultTextBrush}"
                                          TextBlock.FontFamily="{StaticResource ParagraphFont}"
                                          TextBlock.FontSize="16"
                                          Margin="0,8,0,8" />
                        <ItemsControl x:Name="PART_OfferStipulationList"
                                      Margin="0,8,0,8"
                                      HorizontalContentAlignment="Center"
                                      Foreground="LimeGreen"
                                      FontFamily="{StaticResource ParagraphFont}"
                                      FontSize="16">
                          <ItemsControl.Resources>
                            <Style TargetType="{x:Type Hyperlink}"
                                   BasedOn="{StaticResource {x:Type Hyperlink}}">
                              <Setter Property="TextElement.Foreground">
                                <Setter.Value>
                                  <SolidColorBrush Color="{Binding Source={x:Static Colors.LimeGreen}, BindsDirectlyToSource=True, Converter={StaticResource LightColorConverter}}" />
                                </Setter.Value>
                              </Setter>
                            </Style>
                          </ItemsControl.Resources>
                        </ItemsControl>
                        <ContentPresenter x:Name="PART_ProposalDemandsLeadInPresenter"
                                          TextBlock.Foreground="{StaticResource DefaultTextBrush}"
                                          TextBlock.FontFamily="{StaticResource ParagraphFont}"
                                          TextBlock.FontSize="16"
                                          Margin="0,8,0,8" />
                        <ItemsControl x:Name="PART_DemandStipulationList"
                                      Margin="0,8,0,8"
                                      HorizontalContentAlignment="Center"
                                      Foreground="Crimson"
                                      FontFamily="{StaticResource ParagraphFont}"
                                      FontSize="16">
                          <ItemsControl.Resources>
                            <Style TargetType="{x:Type Hyperlink}"
                                   BasedOn="{StaticResource {x:Type Hyperlink}}">
                              <Setter Property="TextElement.Foreground">
                                <Setter.Value>
                                  <SolidColorBrush Color="{Binding Source={x:Static Colors.Crimson}, BindsDirectlyToSource=True, Converter={StaticResource LightColorConverter}}" />
                                </Setter.Value>
                              </Setter>
                            </Style>
                          </ItemsControl.Resources>
                        </ItemsControl>
                      </StackPanel>
                    </StackPanel>
                  </Border>
                </DockPanel>
              </ScrollViewer>
            </Border>

            <StackPanel x:Name="RelationshipInfoPanel"
                        Grid.Column="4"
                        Grid.Row="5"
                        Grid.RowSpan="2"
                        Orientation="Vertical"
                        DataContext="{Binding}"
                        Margin="14,0,-7,0"
                        VerticalAlignment="Top">
              <Border Width="180"
                      Height="180"
                      BorderBrush="White"
                      BorderThickness="2"
                      CornerRadius="12">
                <Border.Background>
                  <ImageBrush ImageSource="{Binding Path=OtherCiv, Converter={StaticResource CivImageConverter}}"
                              Stretch="UniformToFill" />
                </Border.Background>
              </Border>
              <TextBlock FontFamily="{StaticResource DefaultFont}"
                         FontSize="24"
                         Foreground="{StaticResource HeaderTextBrush}"
                         Text="{Binding Path=OtherCiv.LongName, Converter={StaticResource UpperCaseConverter}}"
                         TextAlignment="Center"
                         TextWrapping="Wrap"
                         TextTrimming="CharacterEllipsis"
                         Margin="0,8,0,0" />
              <s:BlockBar IsReadOnly="True"
                          Height="28"
                          Margin="0,8,0,0"
                          BlockCount="20"
                          BlockMargin="2"
                          Value="{Binding Path=Attitude.PercentFilled, Mode=OneWay}" />
            </StackPanel>

          </Grid>

          <!-- Control Template Triggers -->
          <ControlTemplate.Triggers>
            <Trigger SourceName="PART_CivilizationList"
                     Property="SelectedItem"
                     Value="{x:Null}">
              <Setter TargetName="RelationshipInfoPanel"
                      Property="Visibility"
                      Value="Hidden" />
            </Trigger>
            <Trigger Property="local:DiplomacyScreen.CurrentView"
                     Value="{x:Static local:DiplomacyScreenViewType.Inbox}">
              <Setter TargetName="PART_ViewButton_Inbox"
                      Property="Style"
                      Value="{StaticResource SelectedSidebarButton}" />
              <Setter TargetName="PART_CivilizationList"
                      Property="Visibility"
                      Value="Collapsed" />
              <Setter TargetName="PART_IncomingMessageList"
                      Property="Visibility"
                      Value="Visible" />
            </Trigger>
            <Trigger Property="local:DiplomacyScreen.CurrentView"
                     Value="{x:Static local:DiplomacyScreenViewType.Outbox}">
              <Setter TargetName="PART_ViewButton_Outbox"
                      Property="Style"
                      Value="{StaticResource SelectedSidebarButton}" />
            </Trigger>
            <Trigger Property="local:DiplomacyScreen.CurrentView"
                     Value="{x:Static local:DiplomacyScreenViewType.Agreements}">
              <Setter TargetName="PART_ViewButton_Agreements"
                      Property="Style"
                      Value="{StaticResource SelectedSidebarButton}" />
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="local:DiplomacyScreen.CurrentView"
                           Value="{x:Static local:DiplomacyScreenViewType.Agreements}" />
                <Condition Property="local:DiplomacyScreen.IsCurrentRelationshipNull"
                           Value="False" />
              </MultiTrigger.Conditions>
              <MultiTrigger.Setters>
                <Setter TargetName="ActiveAgreementsPanel"
                        Property="Visibility"
                        Value="Visible" />
              </MultiTrigger.Setters>
            </MultiTrigger>
            <Trigger Property="local:DiplomacyScreen.CurrentView"
                     Value="{x:Static local:DiplomacyScreenViewType.Overview}">
              <Setter TargetName="PART_ViewButton_Overview"
                      Property="Style"
                      Value="{StaticResource SelectedSidebarButton}" />
              <Setter TargetName="GraphContainer"
                      Property="Visibility"
                      Value="Visible" />
              <Setter TargetName="PART_CivilizationList"
                      Property="Visibility"
                      Value="Collapsed" />
              <Setter TargetName="MessagePanel"
                      Property="Visibility"
                      Value="Collapsed" />
              <Setter TargetName="RelationshipInfoPanel"
                      Property="Visibility"
                      Value="Collapsed" />
              <Setter TargetName="UpperHorizontalDivider"
                      Property="Visibility"
                      Value="Visible" />
              <Setter TargetName="LowerLeftSide"
                      Property="Grid.Row"
                      Value="2" />
              <Setter TargetName="LowerLeftSide"
                      Property="Grid.RowSpan"
                      Value="5" />
              <Setter TargetName="LowerRightSide"
                      Property="Grid.Row"
                      Value="1" />
              <Setter TargetName="LowerRightSide"
                      Property="Grid.RowSpan"
                      Value="7" />
              <Setter TargetName="UpperLeftSide"
                      Property="Visibility"
                      Value="Collapsed" />
              <Setter TargetName="LowerUpperLeftCorner"
                      Property="Visibility"
                      Value="Collapsed" />
              <Setter TargetName="UpperLowerLeftCorner"
                      Property="Visibility"
                      Value="Collapsed" />
              <Setter TargetName="UpperMiddleLeftHorizontalDivider"
                      Property="Visibility"
                      Value="Collapsed" />
              <Setter TargetName="LowerMiddleLeftHorizontalDivider"
                      Property="Visibility"
                      Value="Collapsed" />
              <Setter TargetName="UpperMiddleRightHorizontalDivider"
                      Property="Visibility"
                      Value="Collapsed" />
              <Setter TargetName="LowerMiddleRightHorizontalDivider"
                      Property="Visibility"
                      Value="Collapsed" />
              <Setter TargetName="UpperCenterDivider"
                      Property="Visibility"
                      Value="Collapsed" />
              <Setter TargetName="MiddleCenterDivider"
                      Property="Visibility"
                      Value="Collapsed" />
              <Setter TargetName="LowerCenterDivider"
                      Property="Visibility"
                      Value="Collapsed" />
              <Setter TargetName="LowerLeftHorizontalDivider"
                      Property="Grid.ColumnSpan"
                      Value="3" />
              <Setter TargetName="LowerRightHorizontalDivider"
                      Property="Visibility"
                      Value="Collapsed" />
              <Setter TargetName="LowerUpperRightCorner"
                      Property="Visibility"
                      Value="Collapsed" />
              <Setter TargetName="UpperLowerRightCorner"
                      Property="Visibility"
                      Value="Collapsed" />
              <Setter TargetName="UpperRightSide"
                      Property="Visibility"
                      Value="Collapsed" />
            </Trigger>
            <Trigger Property="local:DiplomacyScreen.IsCurrentMessageIncoming"
                     Value="True">
              <Setter TargetName="InboxButtons"
                      Property="Visibility"
                      Value="Visible" />
              <Setter TargetName="PART_CommDetailsHeading"
                      Property="Text"
                      Value="INCOMING TRANSMISSION" />
            </Trigger>
            <Trigger Property="local:DiplomacyScreen.IsCurrentMessageOutgoing"
                     Value="True">
              <Setter TargetName="DraftButtons"
                      Property="Visibility"
                      Value="Visible" />
            </Trigger>
            <Trigger Property="local:DiplomacyScreen.IsCurrentMessageDraft"
                     Value="True">
              <Setter TargetName="PART_CommDetailsHeading"
                      Property="Text"
                      Value="PREPARING TRANSMISSION" />
            </Trigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="local:DiplomacyScreen.IsCurrentRelationshipNull"
                           Value="False" />
                <Condition Property="local:DiplomacyScreen.IsCurrentMessageNull"
                           Value="True" />
                <Condition Property="local:DiplomacyScreen.CurrentView"
                           Value="{x:Static local:DiplomacyScreenViewType.Outbox}" />
              </MultiTrigger.Conditions>
              <MultiTrigger.Setters>
                <Setter TargetName="OutboxButtons"
                        Property="Visibility"
                        Value="Visible" />
              </MultiTrigger.Setters>
            </MultiTrigger>
            <MultiTrigger>
              <MultiTrigger.Conditions>
                <Condition Property="local:DiplomacyScreen.IsCurrentMessageOutgoing"
                           Value="True" />
                <Condition Property="local:DiplomacyScreen.IsCurrentMessageDraft"
                           Value="False" />
              </MultiTrigger.Conditions>
              <MultiTrigger.Setters>
                <Setter TargetName="PART_CommDetailsHeading"
                        Property="Text"
                        Value="OUTGOING TRANSMISSION" />
              </MultiTrigger.Setters>
            </MultiTrigger>
            <MultiDataTrigger>
              <MultiDataTrigger.Conditions>
                <Condition Binding="{Binding Path=IsCurrentMessageOutgoing, RelativeSource={RelativeSource Self}}"
                           Value="True" />
                <Condition Binding="{Binding Path=CurrentMessage.IsProposal, RelativeSource={RelativeSource Self}}"
                           Value="True" />
              </MultiDataTrigger.Conditions>
              <MultiDataTrigger.Setters>
                <Setter TargetName="StipulationListBorder"
                        Property="Visibility"
                        Value="Visible" />
              </MultiDataTrigger.Setters>
            </MultiDataTrigger>
            <Trigger SourceName="MessagePanel"
                     Property="DataContext"
                     Value="{x:Null}">
              <Setter TargetName="MessagePanel"
                      Property="Visibility"
                      Value="Hidden" />
            </Trigger>
            <Trigger SourceName="PART_CommDetailsHeading"
                     Property="Text"
                     Value="">
              <Setter TargetName="PART_CommDetailsHeading"
                      Property="Visibility"
                      Value="Collapsed" />
            </Trigger>
            <DataTrigger Binding="{Binding ElementName=PART_MutualStipulationList, Path=Items.Count}"
                         Value="0">
              <Setter TargetName="PART_MutualStipulationList"
                      Property="Visibility"
                      Value="Collapsed" />
            </DataTrigger>
            <DataTrigger Binding="{Binding ElementName=PART_OfferStipulationList, Path=Items.Count}"
                         Value="0">
              <Setter TargetName="PART_OfferStipulationList"
                      Property="Visibility"
                      Value="Collapsed" />
              <Setter TargetName="PART_ProposalOffersLeadInPresenter"
                      Property="Visibility"
                      Value="Collapsed" />
            </DataTrigger>
            <DataTrigger Binding="{Binding ElementName=PART_DemandStipulationList, Path=Items.Count}"
                         Value="0">
              <Setter TargetName="PART_DemandStipulationList"
                      Property="Visibility"
                      Value="Collapsed" />
              <Setter TargetName="PART_ProposalDemandsLeadInPresenter"
                      Property="Visibility"
                      Value="Collapsed" />
            </DataTrigger>
            <Trigger SourceName="PART_ProposalDemandsLeadInPresenter"
                     Property="Content"
                     Value="{x:Null}">
              <Setter TargetName="PART_ProposalDemandsLeadInPresenter"
                      Property="Visibility"
                      Value="Collapsed" />
            </Trigger>
            <Trigger SourceName="PART_ProposalOffersLeadInPresenter"
                     Property="Content"
                     Value="{x:Null}">
              <Setter TargetName="PART_ProposalOffersLeadInPresenter"
                      Property="Visibility"
                      Value="Collapsed" />
            </Trigger>
          </ControlTemplate.Triggers>
        </ControlTemplate>
      </Setter.Value>
    </Setter>
  </Style>

</ResourceDictionary>